Skip to main content

Import

Usage

Parameters

The hook accepts an optional configuration object with the following properties:

Return Type: UseWaasFeeOptionsReturnType

The hook returns a tuple with the following elements:

Properties

pendingFeeOptionConfirmation

WaasFeeOptionConfirmation | undefined Object containing the current fee confirmation details if a transaction is pending, or undefined if no transaction is pending confirmation.
When skipFeeBalanceCheck is false, the options will be of type FeeOptionExtended, which includes balance information:

confirmPendingFeeOption

(id: string, feeTokenAddress: string | null) => void Function to confirm the selected fee option.

rejectPendingFeeOption

(id: string) => void Function to reject the current fee option selection.

Notes

This hook provides functionality for handling WaaS (Wallet as a Service) fee options for unsponsored transactions. Key features:
  • Get available fee options for a transaction in Native Token and ERC20 tokens
  • Automatically fetch user wallet balances for each fee option (unless skipFeeBalanceCheck is true)
  • Allow users to select their preferred fee token
  • Confirm or reject fee selections
The hook integrates with the Sequence WaaS provider to intercept fee confirmation requests and presents a user interface to allow selection of the fee token. For a detailed guide on how to use the hook, see the Pay gas in ERC20 guide.